package com.baobao.domain;

import java.io.Serializable;

import java.lang.StringBuilder;

import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

import javax.xml.bind.annotation.*;

import javax.persistence.*;

/**
 */
@IdClass(com.baobao.domain.BbeventPK.class)
@Entity
@NamedQueries({
		@NamedQuery(name = "findAllBbevents", query = "select myBbevent from Bbevent myBbevent"),
		@NamedQuery(name = "findBbeventByBbId", query = "select myBbevent from Bbevent myBbevent where myBbevent.bbId = ?1"),
		@NamedQuery(name = "findBbeventByBbIdContaining", query = "select myBbevent from Bbevent myBbevent where myBbevent.bbId like ?1"),
		@NamedQuery(name = "findBbeventByConfirmPhone", query = "select myBbevent from Bbevent myBbevent where myBbevent.confirmPhone = ?1"),
		@NamedQuery(name = "findBbeventByConfirmPhoneContaining", query = "select myBbevent from Bbevent myBbevent where myBbevent.confirmPhone like ?1"),
		@NamedQuery(name = "findBbeventByConfirmTime", query = "select myBbevent from Bbevent myBbevent where myBbevent.confirmTime = ?1"),
		@NamedQuery(name = "findBbeventByConfirmTimeContaining", query = "select myBbevent from Bbevent myBbevent where myBbevent.confirmTime like ?1"),
		@NamedQuery(name = "findBbeventByPrimaryKey", query = "select myBbevent from Bbevent myBbevent where myBbevent.bbId = ?1 and myBbevent.time = ?2"),
		@NamedQuery(name = "findBbeventByTime", query = "select myBbevent from Bbevent myBbevent where myBbevent.time = ?1"),
		@NamedQuery(name = "findBbeventByTimeContaining", query = "select myBbevent from Bbevent myBbevent where myBbevent.time like ?1"),
		@NamedQuery(name = "findBbeventByTimeBetween", query = "select myBbevent from Bbevent myBbevent where myBbevent.bbId = ?1 and  myBbevent.time between ?2 and ?3 order by myBbevent.time desc"),
		@NamedQuery(name = "findBbeventByType", query = "select myBbevent from Bbevent myBbevent where myBbevent.type = ?1") })
@Table(catalog = "baobaodb", name = "bbevent")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(namespace = "bb/com/baobao/domain", name = "Bbevent")
public class Bbevent implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 */

	@Column(name = "bb_id", length = 40, nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	@XmlElement
	String bbId;
	/**
	 */

	@Column(name = "time", length = 40, nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	@XmlElement
	String time;
	/**
	 */

	@Column(name = "type")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	Integer type;
	/**
	 */

	@Column(name = "confirm_phone", length = 40)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String confirmPhone;
	/**
	 */

	@Column(name = "confirm_time", length = 40)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String confirmTime;

	/**
	 */
	public void setBbId(String bbId) {
		this.bbId = bbId;
	}

	/**
	 */
	public String getBbId() {
		return this.bbId;
	}

	/**
	 */
	public void setTime(String time) {
		this.time = time;
	}

	/**
	 */
	public String getTime() {
		return this.time;
	}

	/**
	 */
	public void setType(Integer type) {
		this.type = type;
	}

	/**
	 */
	public Integer getType() {
		return this.type;
	}

	/**
	 */
	public void setConfirmPhone(String confirmPhone) {
		this.confirmPhone = confirmPhone;
	}

	/**
	 */
	public String getConfirmPhone() {
		return this.confirmPhone;
	}

	/**
	 */
	public void setConfirmTime(String confirmTime) {
		this.confirmTime = confirmTime;
	}

	/**
	 */
	public String getConfirmTime() {
		return this.confirmTime;
	}

	/**
	 */
	public Bbevent() {
	}

	/**
	 * Copies the contents of the specified bean into this bean.
	 *
	 */
	public void copy(Bbevent that) {
		setBbId(that.getBbId());
		setTime(that.getTime());
		setType(that.getType());
		setConfirmPhone(that.getConfirmPhone());
		setConfirmTime(that.getConfirmTime());
	}

	/**
	 * Returns a textual representation of a bean.
	 *
	 */
	public String toString() {

		StringBuilder buffer = new StringBuilder();

		buffer.append("bbId=[").append(bbId).append("] ");
		buffer.append("time=[").append(time).append("] ");
		buffer.append("type=[").append(type).append("] ");
		buffer.append("confirmPhone=[").append(confirmPhone).append("] ");
		buffer.append("confirmTime=[").append(confirmTime).append("] ");

		return buffer.toString();
	}

	/**
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = (int) (prime * result + ((bbId == null) ? 0 : bbId.hashCode()));
		result = (int) (prime * result + ((time == null) ? 0 : time.hashCode()));
		return result;
	}

	/**
	 */
	public boolean equals(Object obj) {
		if (obj == this)
			return true;
		if (!(obj instanceof Bbevent))
			return false;
		Bbevent equalCheck = (Bbevent) obj;
		if ((bbId == null && equalCheck.bbId != null) || (bbId != null && equalCheck.bbId == null))
			return false;
		if (bbId != null && !bbId.equals(equalCheck.bbId))
			return false;
		if ((time == null && equalCheck.time != null) || (time != null && equalCheck.time == null))
			return false;
		if (time != null && !time.equals(equalCheck.time))
			return false;
		return true;
	}
}
